package program.Command;

import program.Atom;
import program.SExprList;
import program.SExpression;
import roborally.Direction;
import roborally.Robot;

/**
 * A class representing a TURN COUNTERCLOCKWISE command.
 * 
 * @author Jef Keijers/Bachelor of Science: Informatics
 * @version 1.0
 */
public class TurnCounterClockWise extends Command {

	/**
	 * This method let the robot make one turn counterclockwise and afterwards return null.
	 */
	@Override
	public Command execute(Robot robot) {
		robot.turn(Direction.LEFT);
		return null;
	}
	
	/**
	 * This method returns the SExpression representation of turn counterclockwise.
	 */
	@Override
	public SExpression toSExpression() {
		SExprList sexpr = new SExprList();
		sexpr.add(new Atom("turn"));
		sexpr.add(new Atom("counterclockwise"));
		return sexpr;
	}
}
